package com.mxd.service.impl;

import com.mxd.entity.User;
import com.mxd.mapper.UserMapper;
import com.mxd.service.UserService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author mxd
 * @since 2018-09-04
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
	@Autowired
	UserMapper userDao;
	
	@Override
	public boolean login(User user) {
		EntityWrapper<User> wrapper = new EntityWrapper<>(user);
		wrapper.eq("username", user.getUsername()).eq("password",user.getPassword());
		if (userDao.selectList(wrapper).size()!=0) {
			return true;
		}
		return false;
	}
}
